package com.team.mail.order.config;


import com.team.mail.order.interceptor.LoginUserInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 开启拦截器的配置
 */

@Configuration
public class OrderWebConfiguration implements WebMvcConfigurer {

    @Autowired
    private LoginUserInterceptor loginUser;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //拦截所有的
        registry.addInterceptor(loginUser).addPathPatterns("/**");
    }
}
